{% extends 'layout.html' %}

{% block title %}
    <title>新增</title>
{% endblock %}

{% block content %}
    <div class="panel panel-default">
        <!-- Default panel contents -->
        <div class="panel-heading">新增</div>
        <!-- form表单-->
        <div style="box-sizing: border-box;padding: 20px">
            <form method="post" action="{% url 'user_add' %}">
                {#   解决跨站防御攻击            #}
                {% csrf_token %}
                <div class="form-group">
                    <label>用户名</label>
                    <input type="text" class="form-control" name="username"
                           placeholder="请输入用户名">
                </div>
                <div class="form-group">
                    <label>年龄</label>
                    <input type="number" class="form-control" name="age"
                           placeholder="请输入部门地址">
                </div>
                <div class="form-group">
                    <label>性别</label>
                    <select class="form-control" name="gender">
                        {% for gender in genders %}
                            <option value="{{ gender.0 }}">{{ gender.1 }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="form-group">
                    <label>部门</label>
                    <select class="form-control" name="dept_id">
                        {% for dept in depts %}
                            <option value="{{ dept.id }}">{{ dept.name }}</option>
                        {% endfor %}
                    </select>
                </div>
                <button type="submit" class="btn btn-primary">提交</button>
            </form>
        </div>
    </div>

{% endblock %}